<template>
  <div class="wrap">
    <x-header title="设置"></x-header>
    <group>
      <cell title="个人资料" :link="{path: '/userInfo'}" is-link></cell>
      <cell title="修改密码" :link="{path: '/resetPassword'}" is-link></cell>
    </group>
    <x-button type="primary" action-type="button" @click.native="preservation">退出登陆</x-button>
  </div>
</template>

<script>
import { Cell, XHeader, Group, XButton } from 'vux'
export default {
  components: {
    XHeader,
    Group,
    XButton,
    Cell
  },
  data() {
    return {}
  },
  methods: {
    preservation() {
      this.$store.dispatch('FedLogOut').then(() => {
        location.reload() // In order to re-instantiate the vue-router object to avoid bugs
      })
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.wrap{
  height: 100%;
  .vux-header{
    z-index: 2;
  }
  button.weui-btn{
    width: 80%;
    margin: 30px auto;
  }
}
</style>
